package com.jz.thread;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class MethodTask extends Task {


	private Object className;

	private Method method;

	private Object[] args;
	
	

	public MethodTask(long delayTime, Object[] args, Object className, Method method) {
		super(delayTime);
		this.args = args;
		this.className = className;
		this.method = method;
	}



	@Override
	public void run() {
		try {
			method.invoke(className, args);
		} catch (IllegalArgumentException e) {
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			e.printStackTrace();
		} catch (InvocationTargetException e) {
			e.printStackTrace();
		} 

	}

}
